-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore vlan attachment API responses "422 Virtual network foo already…" #62
ignore vlan attachment API responses "422 Virtual network foo already…" #62
Conversation
// Virtual network 1182 already unassigned" | ||
func IsAlreadyDone(err error) bool { | ||
if e, ok := err.(*packngo.ErrorResponse); ok && e.Response != nil { | ||
return e.Response.StatusCode == http.StatusUnprocessableEntity && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is status code 422 enough to identify this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
I am also checking the text included in the error message (the bold elements are being checked):
422 Unprocessable Entity
{"error":"Virtual Network 1234 already attached"}
This will also capture "Virtual Network 1234 already unattached"
(I was originally checking for the text in the wrong place, StatusCode vs errsInOne. Fixed in the latest commits).
… ..." Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
6f55a79
to
89f2b16
Compare
|
Description of your changes
During conformance testing, attachment resources would reach un unready state, despite being ready.
Checklist
I have:
make reviewable
to ensure this PR is ready for review.